New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add convenience methods to read the value of float and int literals #148
Conversation
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these.
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Could you handle number literals with |
@rintaro Ah. I didn’t think about that. Looking into the compiler we’d also need to support
1 - 3 should be fairly easy to implement using I filed SR-11580 to keep track of the issue. |
Don't apply `FileprivateAtFileScope` rule to extensions.
I was trying to get the integer/float value of integer/float literals and was surprised to find there is no method for it and you need to parse the value from the characters in the digits token yourself. I feel like there should be a convenience method for that.
If you disagree and don't think we should increase the API surface for these kinds of methods, I‘m also happy with the decision.